package com.moli.iov.base.enums;

/**
 * 围栏类型 多边形
 *
 * @author whl
 */
public enum FenceShapeEnum {
  CIRCLE(1, "圆"),
  SQUARE(2, "正方形"),
  POLYGON(3, "多边形");

  private int code;

  private String cnName;

  private FenceShapeEnum(int code, String cnName) {
    this.code = code;
    this.cnName = cnName;
  }

  public int getCode() {
    return code;
  }

  public void setCode(int code) {
    this.code = code;
  }

  public String getCnName() {
    return cnName;
  }

  public void setCnName(String cnName) {
    this.cnName = cnName;
  }

  public static String getCodeName(int code) {
    for (FenceShapeEnum e : FenceShapeEnum.values()) {
      if (e.code == code) {
        return e.cnName;
      }
    }
    return null;
  }
}
